import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;


public class ExonFinallyBlock {
	public final int[] SUCCESS = {1};
	public final int[] FAIL = {0};
	public static void main(String[] args) throws Exception {
		try{
			ExonFinallyBlock block = new ExonFinallyBlock();
			int i[] =block.executeTask();
			System.out.println(i[0]);
			
		}catch(Exception e){
			throw e;
		}
	}
	
	
	
	public int[] executeTask(){
		BufferedReader bufferedReader = null;
		try {
			bufferedReader = new BufferedReader(new FileReader("C:\\RK\\Localdebugging\\rama1.txt"));
			String lineString = bufferedReader.readLine();
			System.out.println(lineString);
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return FAIL;
		}
		catch (IOException e) {
			e.printStackTrace();
			return FAIL;
		}
		finally{
			if(bufferedReader !=null)
				try {
					bufferedReader.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			System.out.println("finally block executed");
		}
		return SUCCESS;
	}

}
